//
// Created by shaowenhan on 2020/5/9.
//

#ifndef READINSTANCEWRAPPER_READINSTANCEWRAPPER_H
#define READINSTANCEWRAPPER_READINSTANCEWRAPPER_H

#include <string>
#include <vector>
#include <fstream>
#include "Double.h"

using namespace std;
const int maxElementCountInLine = 100;

class ReadInstanceWrapper
{
private:
    vector<string> m_elements;
    vector<int> m_integers;
    vector<double> m_doubles;
    ifstream m_infile;
public:
    explicit ReadInstanceWrapper(string fileName):
    m_elements(maxElementCountInLine),
    m_integers(maxElementCountInLine),
    m_doubles(maxElementCountInLine),
    m_infile(fileName, ifstream::in){}

    const vector<string> &
    elementsInLine(const string &line, int &size, const vector<char> &separators);
    const vector<int> &
    integersInLine(const string &line, int &size, const vector<char> &separators);
    const vector<double> &
    doublesInLine(const string &line, int &size, const vector<char> &separators);
    bool isEOF() const;
    string readLine();
};


#endif //READINSTANCEWRAPPER_READINSTANCEWRAPPER_H
